home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cmdline.lha / cmdline / README < prev   
Text File  |  1993-04-13  |  8KB  |  190 lines

  1.  
  2.  WHAT IS THIS?
  3.  =============
  4.  This is CmdLine, a C++ library for parsing command arguments and assigning
  5.  the corresponding values to program variables. Also included is cmdparse,
  6.  a program to provide an interface to CmdLine for shell-scripts. See the 
  7.  file named "Overview" for a more thorough introduction!
  8.  
  9.  
  10.  AUTHOR
  11.  ======
  12.  Brad Appleton                     Harris Corp., Computer Systems Division
  13.    Senior Software Engineer        2101 West Cypress Creek Road,  M/S 161 
  14.      brad@ssd.csd.harris.com       Fort Lauderdale, FL  33309-1892  USA
  15.        ...!uunet!travis!brad              Phone: (305) 973-5190
  16.  
  17.  
  18.  COPY/REUSE POLICY
  19.  =================
  20.  Permission is hereby granted to freely copy and redistribute this
  21.  software, provided that the author is clearly credited in all copies
  22.  and derivations. Neither the names of the authors nor that of their
  23.  employers may be used to endorse or promote products derived from this
  24.  software without specific written permission.
  25.  
  26.  
  27.  DISCLAIMER
  28.  ==========
  29.  This software is provided ``As Is'' and without any express or implied
  30.  warranties.  Neither the authors nor any of their employers (including
  31.  any of their subsidiaries and subdivisions) are responsible for maintaining
  32.  or supporting this software or for any consequences resulting from the
  33.  use of this software, no matter how awful, even if they arise from flaws
  34.  in the software.
  35.  
  36.  
  37.  CONTENTS
  38.  ========
  39.  See the file "MANIFEST" in the distribution for a complete list and
  40.  description of all the files included in this release.
  41.  
  42.  
  43.  REQUIREMENTS
  44.  ============
  45.  This software should compile on most Unix platforms with a C++ compiler
  46.  with little or no difficulty.
  47.  
  48.  You will need to tweak the Makefiles a tad in order to make them work
  49.  for your C++ compiler.
  50.  
  51.  CmdLine makes extensive use of the "new" operator but makes no attempt
  52.  to see if allocation failed!  CmdLine assumes that any such desired
  53.  error-checking will be taken care of by the programmer by #including
  54.  the header file <new.h> and using the set_new_handler() function.
  55.  
  56.  COMPILATION OPTIONS
  57.  ===================
  58.  The following names may be `#define'd when building CmdLine.
  59.  
  60.  unix            Needed for unix systems
  61.  vms             Needed for vms systems
  62.  msdos           Needed for MS-DOS systems.
  63.  os2             Needed for OS/2 Systems.
  64.  
  65.  __gplusplus     Needed if you are using g++ as your C++ compiler.
  66.  
  67.  unix_style      (This is the default) Use this to have CmdLine parse
  68.                  command-lines using traditional Unix command-line syntax.
  69.  
  70.  vms_style       (Not yet supported) Use this to have CmdLine parse
  71.                  command-lines using traditional VAX/VMS DCL syntax.
  72.  
  73.  ibm_style       (Not yet supported) Use this to have CmdLine parse
  74.                  command-lines using traditional IBM-PC (MS-DOS) syntax.
  75.  
  76.  DEBUG_CMDLINE   Enables use of the "dump" member functions in the CmdLine
  77.                  library.
  78.  
  79.  TEMPLATES       #define this if your C++ compiler supports templates.
  80.  
  81.  GNU_READLINE    Use this if you want CmdLine to use the readline library
  82.                  (from the FSF) when prompting the user for arguments.
  83.                  You will probably also need to link with this library.
  84.  
  85.  
  86.  PORTING
  87.  =======
  88.  You may need to tweak the makefiles a bit in order to get CmdLine to build
  89.  properly.  First look at "Config.mk" and change the make-variables to what-
  90.  ever is appropriate for your operating system and compilation environment.
  91.  If you are on an operating system other than Unix, you will also need to
  92.  change all of the "include" statements in the Makefiles to use the proper
  93.  pathname syntax.  If you change the definitions of $(LIBDIR) and $(INCDIR)
  94.  in Config.mk then you should also modify the file doc/macros.man to indicate
  95.  the new locations for where these files are installed.
  96.  
  97.  You should be aware of the following when porting CmdLine to other platforms.
  98.  
  99.  1) CmdLine assumes that at least one of __STDC__ or __ANSI_CPP__ will be
  100.     #defined if your C++ compiler uses an ANSI-C preprocessor.
  101.  
  102.  2) CmdLine uses <stdarg.h> (not <varargs.h>) to handle functions that may
  103.     take a variable number of arguments.
  104.  
  105.  3) Not all systems have the strtod() function used in src/lib/cmdargs.c,
  106.     If your system DOES have strtod but it is NOT in <stdlib.h> then you
  107.     will need to add a prototype for it in src/lib/cmdargs.c.  It is possible
  108.     (but less likely) that you may have similar problems with strtol().
  109.  
  110.  4) CmdLine uses the AT&T C++ iostream library.  Beyond that, all the
  111.     #include files it uses are assumed to have the contents specified by
  112.     the ANSI-C standard and are assumed to have #ifdef __cplusplus statements
  113.     for when they are being included by C++ files.  CmdLine assumes the
  114.     existence of the following system header files:
  115.  
  116.          <stdarg.h>
  117.          <stdlib.h>
  118.          <string.h>
  119.          <ctype.h>
  120.          <iostream.h>
  121.          <fstream.h>
  122.          <strstream.h>
  123.          <malloc.h>    <--- only used on Unix systems
  124.  
  125.  
  126.  BUGS
  127.  ====
  128.  Please send all bug reports to Brad Appleton <brad@ssd.csd.harris.com>.
  129.  Dont forget to mention which version of CmdLine you have and which
  130.  operating system and C++ compiler you are using.
  131.  
  132.  
  133.  ACKNOWLEDGEMENTS
  134.  ================
  135.  CmdLine is a C++ rewrite of ParseArgs.  The author of this software would
  136.  like to thank Eric Allman and Peter da Silva for their great ideas.
  137.  
  138.  
  139.  FURTHER INFORMATION
  140.  ===================
  141.  For an introduction -- look at the file "Overview" in the distribution!
  142.  
  143.  The documentation is in Unix manpage format (troff with the -man macros)
  144.  and may be found in the "doc" directory but you should be able to find
  145.  out quite a bit by reading the comments in the source files (especially
  146.  in <cmdline.h> and <cmdargs.h>) and by looking at the sample test-program(s).
  147.  
  148.  
  149.  HISTORY
  150.  =======
  151.  Look at the file src/lib/patchlevel.c to see what version of CmdLine you
  152.  have.  Any changes made to the CmdLine product should be documented here:
  153.  
  154.  
  155.  07/21/92        Brad Appleton        <brad@ssd.csd.harris.com>
  156.  -----------------------------------------------------------------------------
  157.  First release.
  158.  
  159.  
  160.  11/13/92        Brad Appleton        <brad@ssd.csd.harris.com>
  161.  -----------------------------------------------------------------------------
  162.  Made some fixes to get the package to compile with g++ and Borland C++.
  163.  
  164.  
  165.  02/24/93        Brad Appleton        <brad@ssd.csd.harris.com>
  166.  -----------------------------------------------------------------------------
  167.  Made some more fixes to get the package to compile with g++.
  168.  
  169.  
  170.  03/03/93        Brad Appleton        <brad@ssd.csd.harris.com>
  171.  -----------------------------------------------------------------------------
  172.  Added a few new features:
  173.  
  174.  - A description string may now be attached to a CmdLine object and it will
  175.    be printed (with the heading "Description:") as the last part of verbose
  176.    usage messages if the description-string is non-NULL and non-empty.
  177.  
  178.  - Added a "sequence" to a CmdArg that indicates the relative order in
  179.    which the arguments appeared on the command line. Also added a member
  180.    to CmdLine that returns the number of valid arguments found (the sequence
  181.    of an argument will be zero if it was not given, otherwise it will be in
  182.    the range 1 .. #valid-args-parsed).
  183.  
  184.  - Added a facility for programmers to setup their own parse-termination
  185.    handler so they can do something besides exit if they so desire.
  186.  
  187.  - Added the ability to allow (at run-time) the use of "+" as the long-option
  188.    prefix (this could be done only at compile-time until now).
  189.    
  190.